package com.chinasofti.framework.base;

import java.util.Date;




/**
 * @author yaoyang
 *2011-11-23
 */

public class App {
	
	private static App m_instance;
	private String m_sessionId;
	private String m_userName;
	private Date m_clientTime;
	private final String m_serviceUrl = 
		"http://192.9.128.65:8080/ServerFrameworkTest/MobileServiceServlet";
	
	private App() {
		m_sessionId = "3314239809UXG891L"; //FOR TEST
	}

	public static App getInstance() {
		if(m_instance == null) {
			m_instance = new App();
		}
		return m_instance;
	}
	
	public String getServiceUrl() {
		return m_serviceUrl;
	}

	public class Location {
		public float Lon;
		public float Lat;
		public Date UpdatedTime; 
	}
	
	public boolean isOnline() {
		return false;
	}
	
	public String getSessionId() {
		return m_sessionId;
	}
	
	public void setSessionId(String sessionId) {
		m_sessionId = sessionId;
	}
	
	public String getUserName() {
		return m_userName;
	}
	
	public void setUserName(String userName) {
		m_userName = userName;
	}
	
	public Location Location() {
		Location location = new Location();
		location.Lat = 30.12456f;
		location.Lon = 46.12546f;
		location.UpdatedTime = Utils.Now();
		return location;
	}
	
	public Date getClientTime() {
		return m_clientTime;
	}
	
	public void syncServerTime(Date time) {
		m_clientTime = time;
	}
	
	public String getIdentity() {
		return "ANDROID" + "-" + "2.2" + "-" + "1.1.0";
	}
	
	public String getPackageName() {
		return "com.cnipr.patent";
	}
	
	public String getLocalDataBasePath() {
		return "";
	}
	
}

